package com.zzyl.serve.controller.member;

import java.util.List;
import javax.servlet.http.HttpServletResponse;

import com.zzyl.common.core.domain.R;
import com.zzyl.serve.domain.NursingProject;
import com.zzyl.serve.service.INursingProjectService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.zzyl.common.annotation.Log;
import com.zzyl.common.core.controller.BaseController;
import com.zzyl.common.core.domain.AjaxResult;
import com.zzyl.common.enums.BusinessType;
import com.zzyl.serve.domain.NursingProWechat;
import com.zzyl.serve.service.INursingProWechatService;
import com.zzyl.common.utils.poi.ExcelUtil;
import com.zzyl.common.core.page.TableDataInfo;

/**
 * 护理项目Controller
 * 
 * @author yanbucai
 * @date 2025-05-08
 */
@RestController
@RequestMapping("/member/orders/project")
@Api(tags = "护理项目相关接口")
public class NursingProWechatController extends BaseController
{
    @Autowired
    private INursingProWechatService nursingProWechatService;


    @Autowired
    private INursingProjectService nursingProjectService;


    /**
     * 查询护理项目列表
     */
//    @PreAuthorize("@ss.hasPermi('member:project:list')")
    @GetMapping("/page")
    @ApiOperation(value = "获取护理项目列表")
    public TableDataInfo<List<NursingProWechat>> list(NursingProWechat nursingProWechat)
    {
        startPage();
        List<NursingProWechat> list = nursingProWechatService.selectNursingProWechatList(nursingProWechat);
        return getDataTable(list);
    }

    /**
     * 获取护理项目详细信息
     */
    @ApiOperation(value = "获取护理项目详细信息", notes = "获取护理项目详细信息")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Integer id)
    {
        return success(nursingProjectService.selectNursingProjectById(id));
    }


//    /**
//     * 导出护理项目列表
//     */
//
//    @Log(title = "护理项目", businessType = BusinessType.EXPORT)
//    @PostMapping("/export")
//    @ApiOperation("导出护理项目列表")
//    public void export(HttpServletResponse response, NursingProWechat nursingProWechat)
//    {
//        List<NursingProWechat> list = nursingProWechatService.selectNursingProWechatList(nursingProWechat);
//        ExcelUtil<NursingProWechat> util = new ExcelUtil<NursingProWechat>(NursingProWechat.class);
//        util.exportExcel(response, list, "护理项目数据");
//    }
//
//    /**
//     * 获取护理项目详细信息
//     */
//    @GetMapping(value = "/{id}")
//    @ApiOperation("获取护理项目详细信息")
//    public R<NursingProWechat> getInfo(@ApiParam(value = "护理项目ID", required = true)
//            @PathVariable("id") Long id)
//    {
//        return R.ok(nursingProWechatService.selectNursingProWechatById(id));
//    }
//
//    /**
//     * 新增护理项目
//     */
//    @Log(title = "护理项目", businessType = BusinessType.INSERT)
//    @PostMapping
//    @ApiOperation("新增护理项目")
//    public AjaxResult add(@ApiParam(value = "护理项目实体", required = true) @RequestBody NursingProWechat nursingProWechat)
//    {
//        return toAjax(nursingProWechatService.insertNursingProWechat(nursingProWechat));
//    }
//
//    /**
//     * 修改护理项目
//     */
//    @Log(title = "护理项目", businessType = BusinessType.UPDATE)
//    @PutMapping
//    @ApiOperation("修改护理项目")
//    public AjaxResult edit(@ApiParam(value = "护理项目实体", required = true) @RequestBody NursingProWechat nursingProWechat)
//    {
//        return toAjax(nursingProWechatService.updateNursingProWechat(nursingProWechat));
//    }
//
//    /**
//     * 删除护理项目
//     */
//    @Log(title = "护理项目", businessType = BusinessType.DELETE)
//	@DeleteMapping("/{ids}")
//    @ApiOperation("删除护理项目")
//    public AjaxResult remove(@ApiParam(value = "要删除的数据id的数组") @PathVariable Long[] ids)
//    {
//        return toAjax(nursingProWechatService.deleteNursingProWechatByIds(ids));
//    }
}
